public class Main {
    public static void main(String[] args) {
        foo(1, 2, 3, 4, 5);
        foo("zhangsan","lisi",1,2,3);
    }

    public static void foo(Object... rest) {
        System.out.println("多参函数"+rest[0]);
        System.out.println("多参函数"+rest[1]);
        System.out.println("多参函数"+rest[2]);
        System.out.println("多参函数"+rest[3]);
        System.out.println("多参函数"+rest[4]);
    }

}
